package com.schoolMall.enums;

/**
 * @author:zyh
 * @Time:2021-08-29-14:55
 * @email:1269231889@qq.com
 */
public enum ShopStateEnum {
    CHECK(0, "审核"),
    OFFLINE(-1, "下线"),
    PASS(1, "通过"),
    SUCCESS(2, "成功"),
    INNER_ERROR(-1001, "内部错误"),
    NULL_SHOP(-1002, "shop为空");


    private int state;
    private String desc;

    ShopStateEnum(int state, String desc) {
        this.state = state;
        this.desc = desc;
    }

    public int getState() {
        return state;
    }

    public String getDesc() {
        return desc;
    }

    public static ShopStateEnum stateOf(int state) {
        for (ShopStateEnum value : values()) {
            if (value.getState() == state) {
                return value;
            }
        }
        return null;
    }
}
